<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.news.bean.NewsType;"%>
<%
            String path = request.getContextPath();
            String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <base href="<%=basePath%>">

        <title>My JSP 'MyJsp1001.jsp' starting page</title>

        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
    </head>

    <body>
        <script type="text/javascript">
            function check(){
                try{
                    var sort =document.getElementById("sort").value;
                    if(isNaN(sort)){
                        alert('顺序必须为数字！');
                        return (false);
                    }else{
                        return (true);
                    }
                }catch(err){
                    alert(err.message);
                    return (false);
                }
            }

        </script>

        
    <LINK href="images/admin_css.css" type=text/css rel=stylesheet>
          <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F9FD">
        <tr bgcolor="#f0f0f0">
            <td width="700" height="25" bgcolor="#D2E8F6">&nbsp;&nbsp;管理信息类别</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="35" align="left"><br>
                <table width="678" height="87" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                        <td height="25" align="left">
                            <table width=90% border="0" cellpadding="0" cellspacing="0">
                                <tr align="center">
                                    <td height="22" colspan=5 align="left"  ><b><font color="#FF6600"><img src="IMAGES/big_sort.gif" width="19" height="20"><a href="newstype?cmd=list">新闻中心</a>[505] </font></b><a href=javascript:Display(notes_dj505)><img src="IMAGES/addinfo.gif" alt="添加下级栏目" width="13" height="13" border="0">点这里增加小类别</a>
                                        <table width="66%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#B5C1D6">
                                            <form name="form1" method="post" action="newstype?cmd=add" onSubmit="return check();">
                                                <tr  id='notes_dj505' style='DISPLAY: none'>
                                                    <td width="67" height="25" align="center">名称：<br><br><br><br><br></td>
                                                    <td width="118"><input name="name" type="text" id="name" size="15" dataType="Require"  msg="请填写类别名称！"><br><br><br><br><br></td>
                                                    <td width="56" align="center">顺序：<br><br><br><br><br></td>
                                                    <td width="72" align="left"><input name="sort" type="text" id="sort" size="6" msg="请填写类别排列顺序[必须为数字]！"><br><br><br><br><br></td>
                                                    <td width="91" align="left"><input name="id" type="hidden" id="id" value="505">
                                                        <input type="submit" name="Submit"  value=" 添加 " class="button"><br><br><br><br><br></td>
                                                </tr>
                                            </form>
                                        </table>
                                        <font color="#FF6600"><b><font color="#FF6600"> </font></b></font> </td>
                                </tr>
                                <%
            List<NewsType> list = (List) request.getAttribute("list");
            if (list != null && list.size() > 0) {
                for (NewsType nt : list) {
                                %>
                                <tr>

                                    <td width=48% height="22" align=left valign="bottom"  >&nbsp;&nbsp;<font color="gray">┣</font>&nbsp;<a href="newstype?cmd=add">00000<%=nt.getName()%></a></td>
                                </tr>
                                <%}
            }%>
                                <tr>
                                    <td colspan=5 height=1 background="images/bj_x1.gif" ></td>
                                </tr>
                            </table>

                        </td>
                    </tr>
                </table></td>
        </tr>
    </table>
    <script language="JavaScript">
    function Display(ID)
    {
        if( ID.style.display == 'none' )
        {
            ID.style.display = '' ;
        }
        else
        {
            ID.style.display = 'none' ;
        }
			 
    }

    </script>
</body>
</html>
